gdk_drawable_get_display
gdk_drawable_get_screen
gdk_drawable_get_visual
-gdk_drawable_set_colormap
gdk_drawable_get_colormap
gdk_drawable_get_depth
gdk_drawable_get_size
gdk_drawable_get_type G_GNUC_CONST
gdk_drawable_get_visible_region
gdk_drawable_get_visual
-gdk_drawable_set_colormap
#endif
#endif
return gdk_screen_get_display (gdk_drawable_get_screen (drawable));
}
-/**
- * gdk_drawable_set_colormap:
- * @drawable: a #GdkDrawable
- * @colormap: a #GdkColormap
- *
- * Sets the colormap associated with @drawable. Normally this will
- * happen automatically when the drawable is created; you only need to
- * use this function if the drawable-creating function did not have a
- * way to determine the colormap, and you then use drawable operations
- * that require a colormap. The colormap for all drawables and
- * graphics contexts you intend to use together should match.
- **/
-void
-gdk_drawable_set_colormap (GdkDrawable *drawable,
- GdkColormap *cmap)
-{
- g_return_if_fail (GDK_IS_DRAWABLE (drawable));
- g_return_if_fail (cmap == NULL || gdk_drawable_get_depth (drawable)
- == cmap->visual->depth);
-
- GDK_DRAWABLE_GET_CLASS (drawable)->set_colormap (drawable, cmap);
-}
-
/**
* gdk_drawable_get_colormap:
* @drawable: a #GdkDrawable
gint *width,
gint *height);
- void (*set_colormap) (GdkDrawable *drawable,
- GdkColormap *cmap);
-
GdkColormap* (*get_colormap) (GdkDrawable *drawable);
GdkVisual* (*get_visual) (GdkDrawable *drawable);
GdkScreen* (*get_screen) (GdkDrawable *drawable);
void gdk_drawable_get_size (GdkDrawable *drawable,
gint *width,
gint *height);
-void gdk_drawable_set_colormap (GdkDrawable *drawable,
- GdkColormap *colormap);
GdkColormap* gdk_drawable_get_colormap (GdkDrawable *drawable);
GdkVisual* gdk_drawable_get_visual (GdkDrawable *drawable);
gint gdk_drawable_get_depth (GdkDrawable *drawable);
return offscreen->colormap;
}
-static void
-gdk_offscreen_window_set_colormap (GdkDrawable *drawable,
- GdkColormap*colormap)
-{
- GdkOffscreenWindow *offscreen = GDK_OFFSCREEN_WINDOW (drawable);
-
- if (colormap && GDK_WINDOW_DESTROYED (offscreen->wrapper))
- return;
-
- if (offscreen->colormap == colormap)
- return;
-
- if (offscreen->colormap)
- g_object_unref (offscreen->colormap);
-
- offscreen->colormap = colormap;
- if (offscreen->colormap)
- g_object_ref (offscreen->colormap);
-}
-
-
static gint
gdk_offscreen_window_get_depth (GdkDrawable *drawable)
{
object_class->finalize = gdk_offscreen_window_finalize;
drawable_class->ref_cairo_surface = gdk_offscreen_window_ref_cairo_surface;
- drawable_class->set_colormap = gdk_offscreen_window_set_colormap;
drawable_class->get_colormap = gdk_offscreen_window_get_colormap;
drawable_class->get_depth = gdk_offscreen_window_get_depth;
drawable_class->get_screen = gdk_offscreen_window_get_screen;
static GdkVisual* gdk_window_real_get_visual (GdkDrawable *drawable);
static gint gdk_window_real_get_depth (GdkDrawable *drawable);
static GdkScreen* gdk_window_real_get_screen (GdkDrawable *drawable);
-static void gdk_window_real_set_colormap (GdkDrawable *drawable,
- GdkColormap *cmap);
static GdkColormap* gdk_window_real_get_colormap (GdkDrawable *drawable);
static cairo_region_t* gdk_window_get_clip_region (GdkDrawable *drawable);
drawable_class->get_depth = gdk_window_real_get_depth;
drawable_class->get_screen = gdk_window_real_get_screen;
drawable_class->get_size = gdk_window_real_get_size;
- drawable_class->set_colormap = gdk_window_real_set_colormap;
drawable_class->get_colormap = gdk_window_real_get_colormap;
drawable_class->get_visual = gdk_window_real_get_visual;
drawable_class->ref_cairo_surface = gdk_window_ref_cairo_surface;
window_remove_filters (window);
- gdk_drawable_set_colormap (GDK_DRAWABLE (window), NULL);
-
window_remove_from_pointer_info (window, display);
if (private->clip_region)
return gdk_drawable_get_screen (GDK_WINDOW_OBJECT (drawable)->impl);
}
-static void
-gdk_window_real_set_colormap (GdkDrawable *drawable,
- GdkColormap *cmap)
-{
- GdkWindowObject *private;
-
- g_return_if_fail (GDK_IS_WINDOW (drawable));
-
- if (GDK_WINDOW_DESTROYED (drawable))
- return;
-
- private = (GdkWindowObject *)drawable;
-
- /* different colormap than parent, requires native window */
- if (!private->input_only &&
- cmap != gdk_drawable_get_colormap ((GdkDrawable *)(private->parent)))
- gdk_window_ensure_native ((GdkWindow *)drawable);
-
- gdk_drawable_set_colormap (private->impl, cmap);
-}
-
static GdkColormap*
gdk_window_real_get_colormap (GdkDrawable *drawable)
{
return impl->cairo_surface;
}
-static void
-gdk_quartz_set_colormap (GdkDrawable *drawable,
- GdkColormap *colormap)
-{
- GdkDrawableImplQuartz *impl = GDK_DRAWABLE_IMPL_QUARTZ (drawable);
-
- if (impl->colormap == colormap)
- return;
-
- if (impl->colormap)
- g_object_unref (impl->colormap);
- impl->colormap = colormap;
- if (impl->colormap)
- g_object_ref (impl->colormap);
-}
-
static GdkColormap*
gdk_quartz_get_colormap (GdkDrawable *drawable)
{
drawable_class->ref_cairo_surface = gdk_quartz_ref_cairo_surface;
drawable_class->create_cairo_surface = gdk_quartz_create_cairo_surface;
- drawable_class->set_colormap = gdk_quartz_set_colormap;
drawable_class->get_colormap = gdk_quartz_get_colormap;
drawable_class->get_depth = gdk_quartz_get_depth;
int width,
int height);
-static void gdk_win32_set_colormap (GdkDrawable *drawable,
- GdkColormap *colormap);
-
static GdkColormap* gdk_win32_get_colormap (GdkDrawable *drawable);
static gint gdk_win32_get_depth (GdkDrawable *drawable);
drawable_class->ref_cairo_surface = gdk_win32_ref_cairo_surface;
drawable_class->create_cairo_surface = gdk_win32_create_cairo_surface;
- drawable_class->set_colormap = gdk_win32_set_colormap;
drawable_class->get_colormap = gdk_win32_get_colormap;
drawable_class->get_depth = gdk_win32_get_depth;
static void
gdk_drawable_impl_win32_finalize (GObject *object)
{
- gdk_drawable_set_colormap (GDK_DRAWABLE (object), NULL);
-
G_OBJECT_CLASS (_gdk_drawable_impl_win32_parent_class)->finalize (object);
}
return GDK_DRAWABLE_IMPL_WIN32 (drawable)->colormap;
}
-static void
-gdk_win32_set_colormap (GdkDrawable *drawable,
- GdkColormap *colormap)
-{
- GdkDrawableImplWin32 *impl = GDK_DRAWABLE_IMPL_WIN32 (drawable);
-
- if (impl->colormap == colormap)
- return;
-
- if (impl->colormap)
- g_object_unref (impl->colormap);
- impl->colormap = colormap;
- if (impl->colormap)
- g_object_ref (impl->colormap);
-}
-
/* Drawing
*/
#include "gdkenumtypes.h"
static GdkColormap* gdk_window_impl_win32_get_colormap (GdkDrawable *drawable);
-static void gdk_window_impl_win32_set_colormap (GdkDrawable *drawable,
- GdkColormap *cmap);
static void gdk_window_impl_win32_init (GdkWindowImplWin32 *window);
static void gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass);
static void gdk_window_impl_win32_finalize (GObject *object);
object_class->finalize = gdk_window_impl_win32_finalize;
- drawable_class->set_colormap = gdk_window_impl_win32_set_colormap;
drawable_class->get_colormap = gdk_window_impl_win32_get_colormap;
}
return drawable_impl->colormap;
}
-static void
-gdk_window_impl_win32_set_colormap (GdkDrawable *drawable,
- GdkColormap *cmap)
-{
- GdkWindowImplWin32 *impl;
- GdkDrawableImplWin32 *draw_impl;
-
- g_return_if_fail (GDK_IS_WINDOW_IMPL_WIN32 (drawable));
-
- impl = GDK_WINDOW_IMPL_WIN32 (drawable);
- draw_impl = GDK_DRAWABLE_IMPL_WIN32 (drawable);
-
- /* chain up */
- GDK_DRAWABLE_CLASS (parent_class)->set_colormap (drawable, cmap);
-
- if (cmap)
- {
- /* XXX */
- g_print ("gdk_window_impl_win32_set_colormap: XXX\n");
- }
-}
-
void
_gdk_root_window_size_init (void)
{
int width,
int height);
-static void gdk_x11_set_colormap (GdkDrawable *drawable,
- GdkColormap *colormap);
-
static GdkColormap* gdk_x11_get_colormap (GdkDrawable *drawable);
static gint gdk_x11_get_depth (GdkDrawable *drawable);
static GdkScreen * gdk_x11_get_screen (GdkDrawable *drawable);
static GdkVisual* gdk_x11_get_visual (GdkDrawable *drawable);
-static void gdk_drawable_impl_x11_finalize (GObject *object);
-
static const cairo_user_data_key_t gdk_x11_cairo_key;
G_DEFINE_TYPE (GdkDrawableImplX11, _gdk_drawable_impl_x11, GDK_TYPE_DRAWABLE)
_gdk_drawable_impl_x11_class_init (GdkDrawableImplX11Class *klass)
{
GdkDrawableClass *drawable_class = GDK_DRAWABLE_CLASS (klass);
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- object_class->finalize = gdk_drawable_impl_x11_finalize;
drawable_class->ref_cairo_surface = gdk_x11_ref_cairo_surface;
drawable_class->create_cairo_surface = gdk_x11_create_cairo_surface;
- drawable_class->set_colormap = gdk_x11_set_colormap;
drawable_class->get_colormap = gdk_x11_get_colormap;
drawable_class->get_depth = gdk_x11_get_depth;
{
}
-static void
-gdk_drawable_impl_x11_finalize (GObject *object)
-{
- gdk_drawable_set_colormap (GDK_DRAWABLE (object), NULL);
-
- G_OBJECT_CLASS (_gdk_drawable_impl_x11_parent_class)->finalize (object);
-}
-
/**
* _gdk_x11_drawable_finish:
* @drawable: a #GdkDrawableImplX11.
return impl->colormap;
}
-static void
-gdk_x11_set_colormap (GdkDrawable *drawable,
- GdkColormap *colormap)
-{
- GdkDrawableImplX11 *impl;
-
- impl = GDK_DRAWABLE_IMPL_X11 (drawable);
-
- if (impl->colormap == colormap)
- return;
-
- if (impl->colormap)
- g_object_unref (impl->colormap);
- impl->colormap = colormap;
- if (impl->colormap)
- g_object_ref (impl->colormap);
-}
-
static gint
gdk_x11_get_depth (GdkDrawable *drawable)
{
cairo_pattern_t *pattern);
static GdkColormap* gdk_window_impl_x11_get_colormap (GdkDrawable *drawable);
-static void gdk_window_impl_x11_set_colormap (GdkDrawable *drawable,
- GdkColormap *cmap);
static void gdk_window_impl_x11_finalize (GObject *object);
static void gdk_window_impl_iface_init (GdkWindowImplIface *iface);
object_class->finalize = gdk_window_impl_x11_finalize;
- drawable_class->set_colormap = gdk_window_impl_x11_set_colormap;
drawable_class->get_colormap = gdk_window_impl_x11_get_colormap;
}
return drawable_impl->colormap;
}
-static void
-gdk_window_impl_x11_set_colormap (GdkDrawable *drawable,
- GdkColormap *cmap)
-{
- GdkDrawableImplX11 *draw_impl;
-
- g_return_if_fail (GDK_IS_WINDOW_IMPL_X11 (drawable));
-
- draw_impl = GDK_DRAWABLE_IMPL_X11 (drawable);
-
- if (cmap && GDK_WINDOW_DESTROYED (draw_impl->wrapper))
- return;
-
- /* chain up */
- GDK_DRAWABLE_CLASS (gdk_window_impl_x11_parent_class)->set_colormap (drawable, cmap);
-
- if (cmap)
- {
- XSetWindowColormap (GDK_SCREEN_XDISPLAY (draw_impl->screen),
- draw_impl->xid,
- GDK_COLORMAP_XCOLORMAP (cmap));
-
- if (((GdkWindowObject*)draw_impl->wrapper)->window_type !=
- GDK_WINDOW_TOPLEVEL)
- gdk_window_add_colormap_windows (GDK_WINDOW (draw_impl->wrapper));
- }
-}
-
-
void
_gdk_windowing_window_init (GdkScreen * screen)
{